package com.pine.app.module.security.core.common.enums;

/**
 * ResponseType类型枚举
 * Created by xyjxu on 2019/10/17.
 */
public enum ResponseType {
    CODE("code"),
    TOKEN("token");


    private String code;

    ResponseType(String code){
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public static ResponseType getByCode(String code){
        ResponseType[] responseTypes =   ResponseType.values();
        for(ResponseType responseType:responseTypes ){
            if(responseType.code.equalsIgnoreCase(code)){
                return responseType;
            }
        }
        return null;

    }
}
